 source('/data1/bsi/BORA_processing/devel/eqtl/parallelize_genotypingsurvival/Matrix_eQTL_R_Source/Matrix_eQTL_R/Matrix_eQTL_engine.R')
expr<-read.table(' /data1/bsi/BORA_processing/devel/eqtl/geneexpression_survival_bootstrap/input_expr',sep="\t",head=T)
expr<-read.table('/data1/bsi/BORA_processing/devel/eqtl/geneexpression_survival_bootstrap/input_expr',sep="\t",head=T)
expr<-read.table('/data1/bsi/BORA_processing/devel/eqtl/parallelize_genotypingsurvival/input_withcorrecthead.tped',sep=" ",head=T)
expr<-read.table('/data1/bsi/BORA_processing/devel/eqtl/geneexpression_survival_bootstrap/input_expr',sep="\t",head=T)
geno<-read.table('/data1/bsi/BORA_processing/devel/eqtl/parallelize_genotypingsurvival/input_withcorrecthead.tped',sep=" ",head=T)
ref<-read.table("/data1/bsi/BORA_processing/devel/eqtl/parallelize_genotypingsurvival/result_ref_file",sep="\t",head=T)
rownames(ref)<-ref[,1]
expr1<-merge(ref,expr,by="row.names",all.x=F)
vOutputThreshold_cis = 1e-4;
pvOutputThreshold_tra = 1e-4;
snpspos<-as.matrix(geno[,c(2,1,4)])
colnames(snpspos)<-c("SNP","chrm_snp","pos")
genepos<-as.matrix(expr1[,2:5])
colnames(genepos)<-c("geneid","chrm_probe","s1","s2")
useModel = modelLINEAR;
output_file_name = 'eQTL_results_R.txt';
cisDist = 1e6;
snps<-geno[,c(2,5:ncol(geno))]
gene<-expr1[,c(2,6:7)]
errorCovariance = character();
Matrix_eQTL_engine_cis(snps,gene, output_file_name,pvOutputThreshold_cis,pvOutputThreshold_tra,useModel,errorCovariance,verbose = TRUE,snpspos,genepos,cisDist)
